<?php

class m110724_011427_loan_hide extends CDbMigration
{
	public function safeUp()
	{
		$this->execute('CREATE TABLE `dycrm_global_configuration` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`key` VARCHAR( 255 ) NOT NULL ,
`title` VARCHAR( 255 ) NOT NULL ,
`description` TEXT NOT NULL ,
`type` VARCHAR( 255 ) NOT NULL ,
`value` TEXT NOT NULL ,
`lastValue` TEXT NOT NULL ,
UNIQUE (`key`)
) ENGINE = InnoDB;');
		$this->insert('dycrm_global_configuration', array(
		'key'=>'SYSTEM_MANAGE_MODE',
		'title'=>'System Manage Mode',
		'description'=>'Set the system manage mode. If YES, the system is in "Management Mode".',
		'type'=>'boolean',
		'value'=>'1',
		'lastValue'=>'0',
		));
		$this->addColumn('dycrm_loan', 'hidden', 'boolean');
		$this->update('dycrm_loan', array('hidden'=>'0'));
	}

	public function safeDown()
	{
		$this->dropTable('dycrm_global_configuration');
		$this->dropColumn('dycrm_loan', 'hidden');
	}
}